final int TouchR = 10;

boolean isPaintTouchPointer = false;

int m_iStartX = 0;
int m_iStartY = 0;

int m_iEndX = 0;
int m_iEndY = 0;

int m_iCurrentX = 0;
int m_iCurrentY = 0;

int rec_x = 0;
int rec_y = 0;
int rec_w = 0;
int rec_h = 0;

int dx = 0;
int dy = 0;

int m_iImgLocationX = 0;
int m_iImgLocationY = 0;

int m_iOldImgLocationX = 0;
int m_iOldImgLocationY = 0;

// IsMotionEvents = hasPointerMotionEvents();
// IsPointerEvents = hasPointerEvents();
		// if(IsMotionEvents)
		// {
			// System.out.println(">>> has Pointer Motion Events");
		// }
		// if(IsPointerEvents)
		// {
			// System.out.println(">>> has Pointer Events");
		// }
protected void pointerPressed(int x, int y)
{
	m_iStartX = x;
	m_iStartY = y;
	
	m_iCurrentX = x;
	m_iCurrentY = y;
	
	m_iOldImgLocationX = m_iImgLocationX;
	m_iOldImgLocationY = m_iImgLocationY;
	
	isPaintTouchPointer = true;
}

protected void pointerReleased(int x, int y)
{
	m_iEndX = x;
	m_iEndY = y;
	
	m_iStartX = m_iStartY = m_iCurrentX = m_iCurrentY = 0;
	
	isPaintTouchPointer = false;
}

protected void pointerDragged(int x, int y)
{
	m_iCurrentX = x;
	m_iCurrentY = y;
	
	dx = m_iCurrentX - m_iStartX;
	dy = m_iCurrentY - m_iStartY;
	
	m_iImgLocationX = m_iOldImgLocationX + dx;
	m_iImgLocationY = m_iOldImgLocationY + dy;
}

void PaintTouchPointer()
{
	s_g.setColor(0,0,255);
	s_g.fillArc(m_iCurrentX - TouchR, m_iCurrentY - TouchR, 2*TouchR, 2*TouchR, 0, 360);
}
